package cn.funeralobjects.ams.web.controller;

import cn.funeralobjects.ams.entity.EAccess;
import cn.funeralobjects.ams.service.AccessKeyService;
import cn.funeralobjects.ams.web.api.AccessApi;
import cn.funeralobjects.ams.web.mapper.AccessMapper;
import cn.funeralobjects.ams.web.model.VAccess;
import cn.funeralobjects.common.service.*;
import cn.funeralobjects.common.web.controller.*;
import cn.funeralobjects.common.web.controller.converter.VoMapper;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author FuneralObjects
 * Create date: 2020/5/26 10:11 AM
 */
@RestController
@RequestMapping("/access")
public class AccessController implements AccessApi,
        RestNameController<VAccess, EAccess, Integer>,
        RestCodeController<VAccess, EAccess, Integer>,
        RestEntityController<VAccess, EAccess, Integer>,
        RestEnableController<VAccess, EAccess, Integer>,
        RestCommitController<Integer> {

    @Resource
    private AccessMapper accessMapper;

    @Resource
    private AccessKeyService accessKeyService;

    @Override
    public CodeService<EAccess, Integer> codeService() {
        return accessKeyService;
    }

    @Override
    public CommitService<Integer> commitService() {
        return accessKeyService;
    }

    @Override
    public EnableService<EAccess, Integer> enableService() {
        return accessKeyService;
    }

    @Override
    public EntityService<EAccess, Integer> entityService() {
        return accessKeyService;
    }

    @Override
    public NameService<EAccess, Integer> nameService() {
        return accessKeyService;
    }

    @Override
    public IdService<Integer> idService() {
        return accessKeyService;
    }

    @Override
    public VoMapper<EAccess, VAccess> voMapper() {
        return accessMapper;
    }
}
